<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style >
			*{margin: 0;padding: 0;}
			ul{width: 1050px;margin: 20px auto;display: flex;justify-content: space-around;flex-flow: wrap;}
			ul li{list-style: none;width: 240px;margin-bottom:20px;}
			p.te{height: 24px;} 
			p.te img{padding: 4px;/*border: 1px solid #666;*/}
			h3{color: #e55748;font: 16px/46px "";}
			p{font:10px/20px "";}
			p span{color: #E55748;}
			a{color: #a7a7ac;}
			p b{font-weight:500 ;}
			p b.te{background: #E55748;color: white;padding:2px;}
			p b.te1{border:1px solid #E55748;color: #E55748;margin-left:10px ;padding:2px;}
			p.te img:hover{border: 2px solid #E55748;}
		</style>
	</head>
	<body>
		<ul id="content">
			<!--<li>
				<img src="img/s1.png" />
				<p class="te"><img src="img/s2.png"/></p>
				<h3>￥2999.00</h3>
				<p>vivo X20 全面屏<span>手机</span>全网通 4GB+64GB</p>
				<p>金色 移动联通电信4G<span>手机</span>双卡双待<span>vivo</span></p>
				<p><i>1万+</i><a>条评论</a></p>
				<p><a>vivo旗舰自营店</a></p>
				<p><b class="te">自营</b><b class="te1">赠</b></p>
			</li>-->
		</ul>
	</body>
	<script src="js/json.js"></script>
</html>
<script>
	var obj=[
		{
			"img":"img/s1.png",
			"p":"img/s2.png",
			"p1":"img/s2.png",
			"h":"￥2999.00",
			"span1":"小米手机6",
			"span2":"小米",
			"span3":"全网通 6GB+128GB",
			"span4":"粉色 电信4G",
			"span5":"刘含",
			"span6":"双卡双待",
			"span7":"MI",
			"i":"1000000万+",
			"a":"条赞赏",
			"a1":"vivo旗舰自营店",
			"b":"自营",
			"b1":"送你了"	
		},{
			"img":"img/s1.png",
			"p":"img/s2.png",
			"p1":"img/s2.png",
			"h":"￥99999.00",
			"span1":"华为-人工智能",
			"span2":"人工智能",
			"span3":"全网通 3000GB",
			"span4":"无限屏幕G",
			"span5":"哈哈",
			"span6":"极限",
			"span7":"huawei",
			"i":"1万+",
			"a":"条评论",
			"a1":"华为旗舰自营店",
			"b":"自营",
			"b1":"赠"	
		},{
			"img":"img/s1.png",
			"p":"img/s2.png",
			"p1":"img/s2.png",
			"h":"￥2999.00",
			"span1":"vivo X20 全面屏",
			"span2":"手机",
			"span3":"全网通 4GB+64GB",
			"span4":"金色 移动联通电信4G",
			"span5":"手机",
			"span6":"双卡双待",
			"span7":"vivo",
			"i":"1万+",
			"a":"条评论",
			"a1":"vivo旗舰自营店",
			"b":"自营",
			"b1":"赠"	
		},{
			"img":"img/s1.png",
			"p":"img/s2.png",
			"p1":"img/s2.png",
			"h":"￥2999.00",
			"span1":"步步高",
			"span2":"电脑",
			"span3":"全网通 4GB+64GB",
			"span4":"金色 移动联通电信4G",
			"span5":"手机",
			"span6":"双卡双待",
			"span7":"OPPO",
			"i":"1999万+",
			"a":"条评论",
			"a1":"色系旗舰自营店",
			"b":"自营",
			"b1":"赠"	
		}
	]
	var str ='';
	for(var i=0;i<obj.length;i++){
		
/*		str+="<li><img src="+obj[i].img+"><p class='te'><img src="+obj[i].p+"/></p><h3>"+obj[i].h+"</h3><p>"+obj[i].span1+"<span>"+obj[i].span2+"</span>"+obj[i].span3+"</p><p>"+obj[i].span4+"<span>"+obj[i].span5+"</span>"+obj[i].span6+"<span>"+obj[i].span7+"</span></p><p><i>"+obj[i].i+"</i><a>"+obj[i].a+"</a></p><p><a>"+obj[i].a1+"</a></p><p><b class='te'>"+obj[i].b+"</b><b class='te1'>"+obj[i].b1+"</b></p></li>";
 */
//使用ES6技术
	str += `<li>
				<img src="${obj[i].img}" />
				<p class="te"><img src="${obj[i].p}"/></p>
				<h3>${obj[i].h}</h3>
				<p>${obj[i].span1}<span>${obj[i].span2}</span>${obj[i].span3}</p>
				<p>${obj[i].span4}<span>${obj[i].span5}</span>${obj[i].span6}<span>${obj[i].span7}</span></p>
				<p><i>${obj[i].i}</i><a>${obj[i].a}</a></p>
				<p><a>${obj[i].a1}</a></p>
				<p><b class="te">${obj[i].b}</b><b class="te1">${obj[i].b1}</b></p>
			</li>`
			}
	
	
	
	content.innerHTML=str;

	
	
</script>